package cn.classyex.business.hr.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.classyex.business.hr.mapper.EmployeeSalaryRecordMapper;
import cn.classyex.business.hr.domain.EmployeeSalaryRecord;
import cn.classyex.business.hr.service.IEmployeeSalaryRecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 薪资发放记录管理Service业务层处理
 * 
 * @author yex
 * @date 2021-05-06
 */
@Service
public class EmployeeSalaryRecordServiceImpl implements IEmployeeSalaryRecordService 
{
    @Autowired
    private EmployeeSalaryRecordMapper employeeSalaryRecordMapper;

    /**
     * 查询薪资发放记录管理
     * 
     * @param employeeSalaryId 薪资发放记录管理ID
     * @return 薪资发放记录管理
     */
    @Override
    public EmployeeSalaryRecord selectEmployeeSalaryRecordById(Long employeeSalaryId)
    {
        return employeeSalaryRecordMapper.selectEmployeeSalaryRecordById(employeeSalaryId);
    }

    /**
     * 查询薪资发放记录管理列表
     * 
     * @param employeeSalaryRecord 薪资发放记录管理
     * @return 薪资发放记录管理
     */
    @Override
    public List<EmployeeSalaryRecord> selectEmployeeSalaryRecordList(EmployeeSalaryRecord employeeSalaryRecord)
    {
        return employeeSalaryRecordMapper.selectEmployeeSalaryRecordList(employeeSalaryRecord);
    }

    /**
     * 新增薪资发放记录管理
     * 
     * @param employeeSalaryRecord 薪资发放记录管理
     * @return 结果
     */
    @Override
    public int insertEmployeeSalaryRecord(EmployeeSalaryRecord employeeSalaryRecord)
    {
        employeeSalaryRecord.setCreateTime(DateUtils.getNowDate());
        return employeeSalaryRecordMapper.insertEmployeeSalaryRecord(employeeSalaryRecord);
    }

    /**
     * 修改薪资发放记录管理
     * 
     * @param employeeSalaryRecord 薪资发放记录管理
     * @return 结果
     */
    @Override
    public int updateEmployeeSalaryRecord(EmployeeSalaryRecord employeeSalaryRecord)
    {
        employeeSalaryRecord.setUpdateTime(DateUtils.getNowDate());
        return employeeSalaryRecordMapper.updateEmployeeSalaryRecord(employeeSalaryRecord);
    }

    /**
     * 删除薪资发放记录管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteEmployeeSalaryRecordByIds(String ids)
    {
        return employeeSalaryRecordMapper.deleteEmployeeSalaryRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除薪资发放记录管理信息
     * 
     * @param employeeSalaryId 薪资发放记录管理ID
     * @return 结果
     */
    @Override
    public int deleteEmployeeSalaryRecordById(Long employeeSalaryId)
    {
        return employeeSalaryRecordMapper.deleteEmployeeSalaryRecordById(employeeSalaryId);
    }
}
